<%content_for :title do%><%= @workshop.title %><%end%>
<%content_for :keywords do%><%= @workshop.tag_list %><%end%>
<%content_for :description do%><%=  t("site.meta_desc.workshop")+@workshop.title + ". " + (@workshop.description ? @workshop.description : "") %><%end%>
<%content_for :og_image do %><%= Embed.checkUrlProtocol(@workshop.thumbnail_url,request.protocol) || request.protocol + request.env['HTTP_HOST'] + "/assets/logos/original/defaul_workshop.png" %><% end %>
<%content_for :alternate_urls do%><%=raw alternate_urls(polymorphic_url(@workshop), @workshop)%><%end%>
<%content_for :canonical do%><%= polymorphic_url(@workshop, :locale => params[:locale]) %><%end%>
<% shortURL = request.protocol + request.env['HTTP_HOST'].sub(/^(m|www)\./, '') + workshop_path(@workshop) %>

<section id="show_items" class="layout_show workshop_show">

  <!--++++++++++++++++toolbar+++++++++++++++++++++++-->
  <div class="toolbar_nav-tab_workshop">
    <div class="container-fluid">
      <h4 class="edit-workshop-title">
        <%=t('workshop.titles.show_main')%>
      </h4>
      <% if user_signed_in? and (can? :update, @workshop) %>
        <a href="<%=edit_workshop_path(@workshop)%>" class="btn btn-default pull-right" id="edit_workshop"><i class="fa fa-edit"></i><%=t('workshop.actions.edit_mode_btOn')%></a>
      <%end%>
    </div>
  </div>

  <!--++++++++++++++++header+++++++++++++++++++++++-->
  <% if @workshop.banner.present? %>
    <div style='background-image: url(<%=@workshop.banner.url(:large)%>);' class="workshop_header"></div>
  <% end %>
  <div class="wa_activity_wrapper wa_activity_wrapper_show header_workshop">
    <div class="layout_workshop">
      <!--avatar-->
      <div class="container-img_WS">

      <div style='background-image: url(<%=@workshop.thumbnail_url%>)' class="img-box workshop_thumbnail" ></div>
      </div>
      <section class="information">
        <div class="briefing">
          <!--title-->
          <div class="name">
            <h2 class="title_WS main_title_WS"><%=@workshop.title%></h2>
          </div>
          <!--description-->
          <div class="description"><%=@workshop.description%></div>
        </div>
      </section>
    </div>
  </div>

  <!--++++++++++++++++header/toolbar+++++++++++++++++++++++-->
  <div class="description-activity">
    <div class="box_description">
      <!--tool-->
      <div class="excursion_tool">
        <%= render :partial => 'workshops/workshop-tool-tab', :locals => { :shortURL => shortURL} %>
      </div>
    </div>
  </div>



<!--++++++++++++++++item+++++++++++++++++++++++-->
  <% unless @workshop_activities.blank? %>
    <% @workshop_activities.each do |workshop_activity| %>

      <div class="wa_activity_wrapper wa_activity_wrapper_show">
        
        <% if workshop_activity.wa_type=="WaResource"  %>
          <div id="effect<%=workshop_activity.id%>" class="resources_WS desplegado" > <!--only for resources-->
        <%end%>

        <div class="layout_workshop">
          <% entity = workshop_activity.object %>
          <% className = entity.class.to_s %>
          <% classNameUnderscore = className.underscore %>
          <%= render partial: "#{ className.tableize }/#{ classNameUnderscore }",
               locals:  { classNameUnderscore.to_sym => entity, :prefix_id => "workshop" } %>
        </div>

        <% if workshop_activity.wa_type=="WaResource"  %>
          </div>
        <%end%>

      </div>
    <%end%>
  <%end%>

  <!--++++++++++++++++comments+++++++++++++++++++++++-->
  <div class="description-activity workshop-comments">
    <!--activity (comments) -->
    <div class="activity-box">
      <%= render :partial => 'workshops/evaluate-activity'%>
    </div>
  </div>
</section>


<%content_for :javascript do%>
  $(".showMore").click(function(){
    var mainDiv = $(this).parent();
    if($(this).attr("status")=== "showMore"){
      mainDiv.switchClass( "oculto", "desplegado", 3000);
      $( ".thumbnail_object_WS" ).hide( "slow", function() {
        $( '.show_object_WS' ).show( "drop", { options: "easeInOutBounce"}, { direction: "left" }, 3000 );
      });
      $(this).html('<a><%=t("excursion.actions.show_fewer")%></a>');
      $(this).attr("status", "showFewer");
    }
    else{
      mainDiv.switchClass( "desplegado", "oculto", 1000);
      $( '.show_object_WS' ).hide( "drop", { direction: "left" }, 1000, function() {
        $( '.thumbnail_object_WS' ).show( "drop", { direction: "left" }, 1000 );
      });
      $(this).html('<a><%=t("excursion.actions.show_more")%></a>');
      $(this).attr("status", "showMore");
    }
    return false;
  });
<%end%>
  
